#ifndef __SQLITE_DATABASE_H__
  #define __SQLITE_DATABASE_H__

#include <cstring>

#include "database.h"

#include "sqlite3.h"

using namespace std;

class sqlite_database : public database {
private:
  sqlite3 *db;

public:
  virtual void connect(const string &connection_string, const string &protocol_file = global_empty_string);
  virtual void connect(const string &host, const string &user_id, const string &password, const string &db_name, const string &protocol_file = global_empty_string);
  virtual void disconnect();

  virtual bool is_connected();

  virtual void execute_query(const string &s, record_set &rs, bool append_to_record_set = false);
  virtual void execute_update(const string &s);

  virtual void start_transaction();
  virtual void commit();
  virtual void rollback();

  virtual void lock_table(const string &table_name);
  virtual void unlock_table(const string &table_name);

  //! default constructor
  sqlite_database();

  //! destructor
  virtual ~sqlite_database();
}; // class sqlite_database

#endif
